#ifndef _CKiloutouClient_H_
#define _CKiloutouClient_H_

#include <System.hpp>
#include <Sysutils.hpp>
#include <dstring>
#include "dm_Kiloutou.h"
#include <CDBGrid.h>

//------------------------------------------------------------------------------
#define AGE_Inconnu  -1
#define asClient(a) dmKiloutou->tClient##a->AsString
#define nClient(a)  dmKiloutou->tClient##a->AsInteger
//------------------------------------------------------------------------------
class CKiloutouClient
{
    private:

        AnsiString m_asNom;
        AnsiString m_asPrenom;
        int        m_nAge;
        int        m_nID_CLIENT;
        TIBQuery * MaRequete;

    private:
        void __fastcall _AffecterClient( int nID_CLIENT, const AnsiString &asNom, const AnsiString &asPrenom, const int &nAge = AGE_Inconnu );
    public:
        __fastcall CKiloutouClient( void );
        __fastcall CKiloutouClient( int nID_CLIENT ,const AnsiString &asNom, const AnsiString &asPrenom );
        __fastcall CKiloutouClient( int nID_CLIENT ,const AnsiString &asNom, const AnsiString &asPrenom, const int &nAge );
        __fastcall ~CKiloutouClient( void );
        AnsiString __fastcall GetLibelle( void );

        void __fastcall Open(const AnsiString &asQuery);
        void __fastcall First( void );
        bool __fastcall Next ( void );
        void __fastcall Delete ( TDBGrid *lbClients );
        void __fastcall Insert ( const AnsiString &asNom, const AnsiString &asPrenom, const int &nAge );
        void __fastcall Update ( const AnsiString &asNom, const AnsiString &asPrenom, const int &nAge);
        void __fastcall Close (void);
        void __fastcall EffacerTable( void );


    public:
        __property AnsiString __fastcall Nom =      { read=m_asNom, write=m_asNom };
        __property AnsiString __fastcall Prenom =   { read=m_asPrenom, write=m_asPrenom };
        __property int __fastcall Age =             { read=m_nAge, write=m_nAge };
        __property AnsiString __fastcall Libelle =  { read=GetLibelle };
        __property int __fastcall ID_Client =       { read=m_nID_CLIENT, write=m_nID_CLIENT };
};

#endif